package com.axjy.item.controller;

import com.axjy.comm.vo.Result;
import com.axjy.item.service.IndexFloorService;
import com.axjy.item.vo.IndexFloorItems;
import com.axjy.item.vo.ItemDetailVo;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.*;

@RestController
public class IndexController {
    @Resource
    private IndexFloorService indexFloorService;

    @RequestMapping("/p/index/queryFloorItems")
    public Result queryFloorItems(){
        List<IndexFloorItems> list = indexFloorService.queryFloorItems();
        return Result.success(list);
    }

    @RequestMapping("/p/queryItemDetail")
    public Result queryItemDetail(@RequestBody ItemDetailVo vo){
        ItemDetailVo itemDetailVo = indexFloorService.queryItemDetail(vo.getId());
        return  Result.success(itemDetailVo);
    }
}